for _ in range(int(input())):
l0=list(map(int,input().split()))
n,d,h=l0[0],l0[1],l0[2]
l=list(map(int,input().split()))
ans=0
area=d*h/2
for i in range(len(l)-1):
if l[i+1]-l[i]<h:
delta=l[i+1]-l[i]
ans+=(area-(area)*(1-delta/h)**2)
else:
ans+=area
print(ans+area)
#include<iostream>
#include<iomanip>
#include<string>
using namespace std;
int main(){
int t;
cin>>t;
while(t--){
int n;
double h;
double d;
cin>>n;
cin>>d;
cin>>h;
double k[n];
for(int i=0;i<n;i++){
cin>>k[i];
}
double area=(n*h*d)/2;
double sub;
for(int i=1;i<n;i++){
if((k[i]-k[i-1])<h){
sub=(double)((k[i-1]+h-k[i])*d*(k[i-1]+h-k[i]))/(2*h);
area=area-sub;
}
}
cout<<setprecision(10)<<fixed;
cout<<area<<endl;
}
return 0;
}
Divisible | Three primes |
Coprimes | Cost of balloons |
One String No Trouble | Help Jarvis! |
Lift queries | Goki and his breakup |
Ali and Helping innocent people | Book of Potion making |
Duration | Birthday Party |
e-maze-in | Bricks Game |
Char Sum | Two Strings |
Anagrams | Prime Number |
Lexical Sorting Reloaded | 1514A - Perfectly Imperfect Array |
580A- Kefa and First Steps | 1472B- Fair Division |
996A - Hit the Lottery | MSNSADM1 Football |
MATCHES Playing with Matches | HRDSEQ Hard Sequence |
DRCHEF Doctor Chef | 559. Maximum Depth of N-ary Tree |
821. Shortest Distance to a Character | 1441. Build an Array With Stack Operations |